<!DOCTYPE html>
<html lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta id="wxKeywords" name="Keywords" content="星语心愿" />
<meta id="wxDescription" name="Description" content="星语心愿" />
<title>核对订单_星语心愿</title>
<!--全局resetCss样式开始-->
<link href="../assets/css/reset.css" rel="stylesheet" type="text/css" />
<!--全局resetCss样式结束-->

<!--订单公用commonCss样式开始-->
<link href="../assets/css/order/common.css" rel="stylesheet" type="text/css" />
<!--订单公用commonCss样式结束-->

<!--公用formCss样式开始-->
<link href="../assets/css/common/form.css" rel="stylesheet" type="text/css" />
<!--公用formCss样式结束-->

<!--页面Css样式开始-->
<link href="../assets/css/order/confirm.css" rel="stylesheet" type="text/css" />
<!--页面Css样式结束-->

<!--主题themeCss样式开始-->
<link href="../assets/css/theme.css" rel="stylesheet" type="text/css" />
<!--主题themeCss样式结束-->
</head>
<body>
<!--头部开始-->
<div class="header clearfix">
	
    <!--头部工具栏开始-->
    <div class="header_tool">
		<!--头部工具栏主体开始-->
		<div class="tool_main clearfix">

			<!--左侧工具栏开始-->
			<div class="tool_left clearfix">
				<a>您好，欢迎来到星语心愿，请</a>
				<a href="#" class="green login">登录</a>
				<a href="#" class="orange reg">免费注册</a>

				<!--<a href="#" class="green nickname" title="好命先生好命先生">好命先生</a>
				<a>您好，欢迎来到星语心愿</a>
				<a href="#" class="red loginout">[退出登陆]</a>-->
			</div>
			<!--左侧工具栏结束-->

			<!--右侧工具栏开始-->
			<div class="tool_right clearfix" id="tool_right">
				<ul class="clearfix">
					<li class="clearfix">
						<a class="member_info" href="">
							<span class="tool_img tool_headpic"><img src="../assets/images/content/member_01.jpg" alt="" /></span>
							<span class="tool_nickname" title="凌大厨">凌大厨</span>
							<span class="tool_icon"><i class="icon_common icon_down"></i></span>
						</a>
						<!--展开顶级菜单开始-->
						<ul>
							<li>
								<a href="" title="">我的主页</a>
							</li>
							<li>
								<a href="" title="">账号设置</a>
							</li>
							<li>
								<a href="" title="">退出</a>
							</li>
						</ul>
						<!--展开顶级菜单结束-->
					</li>
					<li class="msg_nums clearfix">
						<a href="" title="">
							<span>消息</span>
							<i class="icon_common icon_nums">12</i>
						</a>
					</li>
					<li class="clearfix">
						<a href="" title="">
							<span>我的订单</span>
							<span class="tool_icon"><i class="icon_common icon_down"></i></span>
						</a>
					</li>
					<li class="clearfix">
						<a href="" title="">
							<span>收藏夹</span>
							<span class="tool_icon"><i class="icon_common icon_down"></i></span>
						</a>
					</li>
					<li class="clearfix">
						<a href="" title="">
							<span>服务分类</span>
							<span class="tool_icon"><i class="icon_common icon_down"></i></span>
						</a>
					</li>
					<li class="clearfix">
						<a href="" title="">
							<span>联系客服</span>
							<span class="tool_icon"><i class="icon_common icon_down"></i></span>
						</a>
					</li>
					<li class="clearfix">
						<a href="" title="">
							<span class="tool_icon"><i class="icon_common icon_app"></i></span>
							<span class="orange">APP下载</span>
						</a>
					</li>
				</ul>
			</div>
			<!--右侧工具栏结束-->
		</div>
		<!--头部工具栏主体结束-->
    </div>
    <!--头部工具栏结束-->
    
    <div class="space_hx">&nbsp;</div>
    
    <!--头部中间内容开始-->
    <div class="header_content clearfix">
    	
        <!--头部logo开始-->
        <div class="header_logo">
        	<a href="#" title>
            	<img src="../assets/images/logo.jpg" alt="" />
            </a>
        </div>
        <!--头部logo结束-->
        
        <!--页面提示开始-->
        <div class="header_tip">核对订单</div>
        <!--页面提示结束-->
        
        <!--订单流程开始-->
        <div class="header_process">
        	<!--注意：hover为当前步骤，passed为已完成步骤-->
        	<!--购物车入口开始-->
        	<ul class="shopcar_process clearfix">
        		<li class="passed">
        			<span class="num">1</span>
        			<span class="title">我的购物车</span>
        		</li>
        		<li class="hover">
        			<span class="num">2</span>
        			<span class="title">填写核对订单信息</span>
        		</li>
        		<li>
        			<span class="num">3</span>
        			<span class="title">确认支付</span>
        		</li>
        		<li>
        			<span class="num">4</span>
        			<span class="title">支付结果</span>
        		</li>
        	</ul>
        	<!--购物车入口结束-->
        	
        	<!--立即购买入口开始-->
        	<!--<ul class="buy_process clearfix">
        		<li class="hover">
        			<span class="num">1</span>
        			<span class="title">填写核对订单信息</span>
        		</li>
        		<li>
        			<span class="num">2</span>
        			<span class="title">确认支付</span>
        		</li>
        		<li>
        			<span class="num">3</span>
        			<span class="title">支付结果</span>
        		</li>
        	</ul>-->
        	<!--立即购买入口结束-->
        </div>
        <!--订单流程结束-->
    </div>
    <!--头部中间内容结束-->
    
</div>
<!--头部结束-->

<!--身体开始-->
<div class="layer clearfix" id="layer">
	
	<!--核对订单表单开始-->
	<form class="confirm_form" name="confirm_form" id="confirm_form" method="">
		
		<!--订单地址开始-->
		<div class="confirm_common confirm_address">
			<!--约见地址开始-->
			<div class="common_title clearfix">
				<span class="left">约见地址</span>
				<span class="right" id="address_add">新增地址</span>
			</div>
			<!--约见地址结束-->
			
			<!--上门地址开始-->
			<!--<div class="common_title clearfix">
				<span class="left">上门地址</span>
				<span class="right" id="address_add">新增地址</span>
			</div>-->
			<!--上门地址结束-->
			
			<!--邮寄地址开始-->
			<!--<div class="common_title clearfix">
				<span class="left">邮寄地址</span>
				<span class="right" id="address_add">新增地址</span>
			</div>-->
			<!--邮寄地址结束-->
			
			<!--线上交易开始-->
			<!--<div class="common_title clearfix">
				<span class="left">线上交易</span>
			</div>-->
			<!--线上交易结束-->
			
			<!--约见、上门、邮寄方式地址列表开始-->
			<div class="address_list" id="address_list">
				<ul>
					<!--默认‘默认地址’高亮hover样式-->
					<li class="clearfix hover">
						<span class="province">
							<em>湖南</em> <em>长沙</em>
							<i class="icon_order icon_hover"></i>
						</span>
						<span class="name">刘友常</span>
						<span class="detail">湖南长沙市岳麓区 麓谷街道麓谷信息港21楼</span>
						<span class="tel">139****9262</span>
						<span class="deal delete">删除</span>
						<span class="deal edit">编辑</span>
						<span class="deal default">默认地址</span>
					</li>
					<li class="clearfix">
						<span class="province">
							<em>湖南</em> <em>长沙</em>
							<i class="icon_order icon_hover"></i>
						</span>
						<span class="name">刘友常</span>
						<span class="detail">湖南长沙市岳麓区 麓谷街道麓谷信息港21楼</span>
						<span class="tel">139****9262</span>
						<span class="deal delete">删除</span>
						<span class="deal edit">编辑</span>
						<span class="deal default">设为默认地址</span>
					</li>
					<li class="clearfix">
						<span class="province">
							<em>湖南</em> <em>长沙</em>
							<i class="icon_order icon_hover"></i>
						</span>
						<span class="name">刘友常</span>
						<span class="detail">湖南长沙市岳麓区 麓谷街道麓谷信息港21楼</span>
						<span class="tel">139****9262</span>
						<span class="deal delete">删除</span>
						<span class="deal edit">编辑</span>
						<span class="deal default">设为默认地址</span>
					</li>
				</ul>
			</div>
			<div class="address_hide" id="address_hide">
				<span>更多地址</span>
				<i class="icon_order icon_show"></i>
			</div>
			<!--约见、上门、邮寄方式地址列表结束-->
			
			<!--线上交易地址开始-->
			<!--<div class="address_list" id="address_list">
				下单完成后与卖家协商服务地址或事宜
			</div>-->
			<!--线上交易地址结束-->
			
			<!--地址栏为空时开始-->
			<!--<div class="address_list" id="address_list">
				您的地址为空，请先添加地址！
			</div>-->
			<!--地址栏为空时结束-->
		</div>
		<!--订单地址结束-->
		
		<!--订购清单开始-->
		<div class="confirm_common confirm_product">
			<div class="common_title clearfix">
				<span class="left">预定订单</span>
				<!--直接购买入口时没有’修改购物车‘-->
				<a href="" class="right" >修改心愿车</a>
			</div>
			<div class="product_list">
				
				<!--商品清单遍历开始-->
				<div class="product_list_box">
							
					<!--星店信息开始-->
					<div class="shop_common shop_info">
						<ul class="clearfix">
							<li class="name clearfix">
								<a href="" title="">刘友常</a>
								<a href="" title="" class="icon clearfix">
									<i class="icon_order icon_zheng"></i>
	                    			<i class="icon_order icon_v_member"></i>
								</a>
							</li>
							<li class="desc">服务名称</li>
							<li class="time">服务时间</li>
							<li class="num">数量</li>
							<li class="money">金额 ( 元 )</li>
						</ul>
					</div>
					<!--星店信息结束-->
						
					<!--星店服务列表开始-->
					<div class="shop_common shop_service" id="shop_service">

						<!--服务遍历开始-->
						<ul class="clearfix">
							<li class="name">
								<a href="" title="">
									<img src="../assets/images/content/detail_01.jpg" alt=""  />
								</a>
							</li>
							<li class="desc">
								<a href="" title="" class="title">和车库咖啡老板苏菂，面对面聊创业！</a>
								<a href="" title="" class="intro">聊聊创业，关于你的项目，或者其他创业者的故事</a>
							</li>
							<li class="time">18-22时（2小时）</li>
							<li class="num">X<em>1</em></li>
							<li class="money" price='12000.00'>￥12000.00</li>
							<!--给卖家留言开始-->
							<li class="message clearfix">
								<span>给卖家留言:</span>
								<input type="text" name="message" class="message" value="" placeholder="还有什么要求跟卖家说？" />
							</li>
							<!--给卖家留言结束-->
						</ul>
						<!--服务遍历结束-->
						<!--服务遍历开始-->
						<ul class="clearfix">
							<li class="name">
								<a href="" title="">
									<img src="../assets/images/content/detail_01.jpg" alt=""  />
								</a>
							</li>
							<li class="desc">
								<a href="" title="" class="title">和车库咖啡老板苏菂，面对面聊创业！</a>
								<a href="" title="" class="intro">聊聊创业，关于你的项目，或者其他创业者的故事</a>
							</li>
							<li class="time">18-22时（2小时）</li>
							<li class="num">X<em>1</em></li>
							<li class="money" price='12000.00'>￥12000.00</li>
							<!--给卖家留言开始-->
							<li class="message clearfix">
								<span>给卖家留言:</span>
								<input type="text" name="message" class="message" value="" placeholder="还有什么要求跟卖家说？" />
							</li>
							<!--给卖家留言结束-->
						</ul>
						<!--服务遍历结束-->

					</div>
					<!--星店服务列表结束-->
					
				</div>
				<!--商品清单遍历结束-->
				
				<!--商品清单遍历开始-->
				<div class="product_list_box">
							
					<!--星店信息开始-->
					<div class="shop_common shop_info">
						<ul class="clearfix">
							<li class="name clearfix">
								<a href="" title="">刘友常</a>
								<a href="" title="" class="icon clearfix">
									<i class="icon_order icon_zheng"></i>
	                    			<i class="icon_order icon_v_member"></i>
								</a>
							</li>
							<li class="desc">服务名称</li>
							<li class="time">服务时间</li>
							<li class="num">数量</li>
							<li class="money">金额 ( 元 )</li>
						</ul>
					</div>
					<!--星店信息结束-->
						
					<!--星店服务列表开始-->
					<div class="shop_common shop_service" id="shop_service">
						
						<!--服务遍历开始-->
						<ul class="clearfix">
							<li class="name">
								<a href="" title="">
									<img src="../assets/images/content/detail_01.jpg" alt=""  />
								</a>
							</li>
							<li class="desc">
								<a href="" title="" class="title">和车库咖啡老板苏菂，面对面聊创业！</a>
								<a href="" title="" class="intro">聊聊创业，关于你的项目，或者其他创业者的故事</a>
							</li>
							<li class="time">18-22时（2小时）</li>
							<li class="num">X<em>1</em></li>
							<li class="money" price='12000.00'>￥12000.00</li>
							<!--给卖家留言开始-->
							<li class="message clearfix">
								<span>给卖家留言:</span>
								<input type="text" name="message" class="message" value="" placeholder="还有什么要求跟卖家说？" />
							</li>
							<!--给卖家留言结束-->
						</ul>
						<!--服务遍历结束-->
						
					</div>
					<!--星店服务列表结束-->
					
				</div>
				<!--商品清单遍历结束-->
				
			</div>
		</div>
		<!--订购清单结束-->
		
		<!--核对订单工具开始-->
		<div class="confirm_tool clearfix">
			<div class="confirm_all">
				总订单金额：<span>￥</span>
				<span class="total_price" id="total_price">36000.00</span>
			</div>
			<div class="confirm_settle">
				<span class="btn submit_order" id="submit_order">提交订单</span>
			</div>
		</div>
		<!--核对订单工具结束-->
		
	</form>
	<!--核对订单表单结束-->
	
	<!--添加地址表单开始-->
	<form class="module_form address_add_form" name="address_add_form" id="address_add_form" method="">
		<div class="module_form_box confirm_address_add" id="confirm_address_add">
			<ul>
				<li class="clearfix">
					<span class="form_point red">*</span>
					<span class="form_title">约见人姓名</span>
					<span class="form_text">
						<input type="text" class="text_common text_input" id="realname" name="realname" value="" placeholder="请填写约见人姓名" null="约见人姓名不能为空" />
					</span>
				</li>
				<li class="clearfix">
					<span class="form_point red">*</span>
					<span class="form_title">所在地区</span>
					<span class="form_text">
						<select name="province" id="province" class="text_common text_select" error="请选择省份">
							<option value="">请选择省份</option>
							<option value="">湖南省</option>
							<option value="">湖北省</option>
						</select>
						<select name="city" id="city" class="text_common text_select" error="请选择所属市">
							<option value="">请选择所属市</option>
							<option value="">长沙市</option>
							<option value="">湘潭市</option>
						</select>
						<select name="area" id="area" class="text_common text_select" error="请选择所属区">
							<option value="">请选择所属区</option>
							<option value="">天心区</option>
							<option value="">岳麓区</option>
						</select>
					</span>
				</li>
				<li class="clearfix">
					<span class="form_point red">*</span>
					<span class="form_title">详细地址</span>
					<span class="form_text">
						<textarea class="text_common text_textarea" id="detail" name="detail" value="" placeholder="请填写约见的详细地址" null="详细地址不能为空"></textarea>
					</span>
				</li>
				<li class="clearfix">
					<span class="form_point red">*</span>
					<span class="form_title">联系方式</span>
					<span class="form_text">
						<input type="text" class="text_common text_input" id="mobile" name="mobile" value="" placeholder="请填写约见的联系方式" null="联系方式不能为空" />
					</span>
				</li>
				<li class="clearfix">
					<span class="form_point red">&nbsp;</span>
					<span class="form_title">&nbsp;</span>
					<span class="form_text">
						<input type="radio" class="text_radio" name="isdefault" value="" />
						设置为默认约见地址
					</span>
				</li>
				<li class="clearfix">
					<span class="form_point red">&nbsp;</span>
					<span class="form_title">&nbsp;</span>
					<span class="form_btn">
						<a class="btn btn_common form_submit">保存</a>
						<a class="btn btn_common form_reset">取消</a>
					</span>
				</li>
			</ul>
		</div>	
	</form>
	<!--添加地址表单结束-->
	
	<!--修改地址表单开始-->
	<form class="module_form address_edit_form" name="address_edit_form" id="address_edit_form" method="">
		<div class="module_form_box confirm_address_edit" id="confirm_address_edit">
			<ul>
				<li class="clearfix">
					<span class="form_point red">*</span>
					<span class="form_title">约见人姓名</span>
					<span class="form_text">
						<input type="text" class="text_common text_input" id="realname" name="realname" value="" placeholder="请填写约见人姓名" null="约见人姓名不能为空" />
					</span>
				</li>
				<li class="clearfix">
					<span class="form_point red">*</span>
					<span class="form_title">约见地址</span>
					<span class="form_text">
						<select name="province" id="province" class="text_common text_select">
							<option value="">请选择省份</option>
							<option value="">湖南省</option>
							<option value="">湖北省</option>
						</select>
						<select name="city" id="city" class="text_common text_select">
							<option value="">请选择所属市</option>
							<option value="">长沙市</option>
							<option value="">湘潭市</option>
						</select>
						<select name="area" id="area" class="text_common text_select">
							<option value="">请选择所属区</option>
							<option value="">天心区</option>
							<option value="">岳麓区</option>
						</select>
					</span>
				</li>
				<li class="clearfix">
					<span class="form_point red">*</span>
					<span class="form_title">详细地址</span>
					<span class="form_text">
						<textarea class="text_common text_textarea" id="detail" name="detail" value="" placeholder="请填写约见的详细地址" null="详细地址不能为空"></textarea>
					</span>
				</li>
				<li class="clearfix">
					<span class="form_point red">*</span>
					<span class="form_title">联系方式</span>
					<span class="form_text">
						<input class="text_common text_input" id="mobile" type="text" name="mobile" value="" placeholder="请填写约见的联系方式" null="联系方式不能为空" />
					</span>
				</li>
				<li class="clearfix">
					<span class="form_point red">&nbsp;</span>
					<span class="form_title">&nbsp;</span>
					<span class="form_text">
						<input type="radio" class="text_radio" name="isdefault" value="" />
						设置为默认约见地址
					</span>
				</li>
				<li class="clearfix">
					<span class="form_point red">&nbsp;</span>
					<span class="form_title">&nbsp;</span>
					<span class="form_btn">
						<a class="btn btn_common form_submit">保存</a>
						<a class="btn btn_common form_reset">取消</a>
					</span>
				</li>
			</ul>	
		</div>
	</form>
	<!--修改地址表单结束-->
	
</div>
<!--身体结束-->

<!--底部开始-->
<div class="footer clearfix">
	
	<!--提供的服务、保障开始-->
    <div class="service footer_service">
    	<ul class="clearfix">
        	<li>
        		<i class="icon_common icon_five5"></i>
                <span>五大服务保障</span>
            </li>
            <li>
        		<i class="icon_common icon_smrz"></i>
                <span>实名认证</span>
            </li>
            <li>
        		<i class="icon_common icon_zzrz"></i>
                <span>资质认证</span>
            </li>
            <li>
        		<i class="icon_common icon_zfaq"></i>
                <span>支付安全</span>
            </li>
            <li>
        		<i class="icon_common icon_zyfw"></i>
                <span>专业服务</span>
            </li>
            <li>
        		<i class="icon_common icon_shwy"></i>
                <span>售后无忧</span>
            </li>
        </ul>
    </div>
	<!--提供的服务、保障结束-->
		
	<!--底部主体开始-->
    <div class="footer_main clearfix">
        
        <!--底部快捷导航开始-->
        <div class="footer_link clearfix">
        	<dl>
            	<dt>
                	新手指南
                </dt>
                <dd>
                	<a href="">注册登录</a>
                </dd>
                <dd>
                	<a href="">完善资料</a>
                </dd>
                <dd>
                	<a href="">购买流程</a>
                </dd>
                <dd>
                	<a href="">会员介绍</a>
                </dd>
                <dd>
                	<a href="">常见问题</a>
                </dd>
            </dl>
            <dl>
            	<dt>
                	支付方式
                </dt>
                <dd>
                	<a href="">在线支付</a>
                </dd>
                <dd>
                	<a href="">星币支付</a>
                </dd>
                <dd>
                	<a href="">转账汇款</a>
                </dd>
            </dl>
            <dl>
            	<dt>
                	安全保障
                </dt>
                <dd>
                	<a href="">实名认证</a>
                </dd>
                <dd>
                	<a href="">资质认证</a>
                </dd>
                <dd>
                	<a href="">支付安全</a>
                </dd>
                <dd>
                	<a href="">专业服务</a>
                </dd>
                <dd>
                	<a href="">售后无忧</a>
                </dd>
            </dl>
            <dl>
            	<dt>
                	售后服务
                </dt>
                <dd>
                	<a href="">发票相关</a>
                </dd>
                <dd>
                	<a href="">退款说明</a>
                </dd>
                <dd>
                	<a href="">忘记密码</a>
                </dd>
                <dd>
                	<a href="">意见反馈</a>
                </dd>
            </dl>
            <dl>
            	<dt>
                	联系我们
                </dt>
                <dd>
                	<a href="">新浪微博</a>
                </dd>
                <dd>
                	<a href="">官方微信</a>
                </dd>
                <dd>
                	<a href="">关于我们</a>
                </dd>
                <dd>
                	<a href="">联系我们</a>
                </dd>
            </dl>
        </div>    
        <!--底部快捷导航结束-->
        
        <!--底部二维码导航开始-->
        <div class="footer_code">
        	<img src="../assets/images/code.jpg" alt="" />
            <p>微信二维码</p>
        </div>  
        <!--底部二维码导航结束-->
        
        <!--底部联系方式开始-->
        <div class="footer_tel">
        	<p class="title">咨询电话</p>
            <p class="number">400-666-6789</p>
            <p>E-mail：400000@qq.com</p>
            <p>QQ：4000 000</p>
        </div>
        <!--底部联系方式结束-->
        
    </div>
	<!--底部主体结束-->
    
    <div class="space_hx">&nbsp;</div>
    
    <!--底部版权信息开始-->
    <div class="footer_copyright">
    	© 2015 长沙星语心愿信息技术有限公司 版权所有   湘ICP备10000087号
    </div>
    <!--底部版权信息结束-->

</div>
<!--底部结束-->

<!--身体右边公用侧边栏开始-->
<div class="body_fixed_nav" id="body_fixed_nav">
	<a href="" title="" class="clearfix">
		<span class="icon"><i class="icon_common icon_msg"></i></span>
		<span class="word">在线留言</span>
	</a>
	<a href="" title="" class="clearfix">
		<span class="icon"><i class="icon_common icon_love"></i></span>
		<span class="word">我的最爱</span>
	</a>
	<a href="" title="" class="clearfix">
		<span class="icon"><i class="icon_common icon_history"></i></span>
		<span class="word">浏览历史</span>
	</a>
	<a href="" title="" class="clearfix">
		<span class="icon"><i class="icon_common icon_collect"></i></span>
		<span class="word">我的收藏</span>				
	</a>
	<a href="javascript:;" title="" id="nav_back_top" class="clearfix">
		<span class="icon"><i class="icon_common icon_backtop"></i></span>
		<span class="word">回到顶部</span>
	</a>
</div>
<!--身体右边公用侧边栏结束-->

<!--Jquery库开始-->
<script type="text/javascript" src="../assets/js/lib/jquery-1.8.3.min.js"></script>
<!--Jquery库结束-->
<!--公用cmmonJS开始-->
<script type="text/javascript" src="../assets/js/common/common.js"></script>
<!--公用cmmonJS结束-->
<!--弹出层插件layer开始-->
<script type="text/javascript" src="../assets/plugins/layer/layer.js"></script>
<!--弹出层插件layer结束-->
<script type="text/javascript">
$(function(){
	//初始化计算订单总价
	//calcTotalFee();
	
	//初始化订单地址数目
	addressNums();
	
	//地址列表收缩
	$('#address_hide').on('click',function(){
		var obj        = $(this).find('i');
		var iconHide   = 'icon_hide';
		var listLiHide = $('#address_list>ul>li:gt(1)');
		var hideHtml   = '收起地址',
			showHtml   = '更多地址';
		if(obj.hasClass(iconHide)){
			obj.removeClass(iconHide).siblings('span').text(showHtml);
			listLiHide.hide();
		}else{
			obj.addClass(iconHide).siblings('span').text(hideHtml);
			listLiHide.show();
		}
	});
	
	//选择订单地址
	$('#address_list>ul>li').on('click',function(){
		$(this).addClass('hover').siblings().removeClass('hover');
	});
	
	//新增订单地址
	$('#address_add').on('click',function(){
		layer.open({
            type: 1,
            title: '新增地址',
            shadeClose: true,
            shade: 0.5,
            closeBtn: 1,
            maxmin: false, //开启最大化最小化按钮
            area: ['520px', '420px'],
            content: $('#confirm_address_add')
        });
	});
	
	//编辑订单地址
	$('body').on('click','#address_list>ul>li>span.edit',function(){
		layer.open({
            type: 1,
            title: '编辑地址',
            shadeClose: true,
            shade: 0.5,
            closeBtn: 1,
            maxmin: false, //开启最大化最小化按钮
            area: ['520px', '420px'],
            content: $('#confirm_address_edit')
        });
	});
	
	//删除订单地址
	$('body').on('click','#address_list>ul>li>span.delete',function(){
		var objClick = $(this);
		layer.confirm('确认删除该地址？', {
		    btn  :['确认','再考虑下'], //按钮
			title:'温馨提示',
			icon :0
		},function(){
		    layer.msg('删除成功！',{icon:1,time:1000},function(){
				objClick.parents('li').remove();
				
				//重新计算订单地址个数
				addressNums();
		    });
		},function(){
		    layer.msg('多谢手下留情！',{icon:6,time:1000});
		});
	});
	
	//提交表单--新增订单地址
	$('body').on('click','#address_add_form .form_submit',function(){
		if(validateAddr($(this))){
			$('#address_add_form').submit();
		}
	});
	
	//提交表单--编辑订单地址
	$('body').on('click','#address_edit_form .form_submit',function(){
		if(validateAddr($(this))){
			$('#address_edit_form').submit();
		}
	});
	
	//点击取消-关闭遮罩
	$('body').on('click','.module_form_box .form_reset',function(){
		layer.closeAll();
	});
	
	//提交表单--核对订单
	$('#submit_order').on('click',function(){
		$('#confirm_form').submit();
	});
});

//计算订单地址数目
function addressNums(){
	var maxNums  = 2;//默认显示2个地址
	var allNums  = $("#address_list>ul>li").size();
	var addrMore = $('#address_hide');
	var addrLi   = "#address_list>ul>li";
	var addrList = $("#address_list");
	if(allNums>maxNums){
		$(addrLi+":gt(1)").hide();
		addrMore.show();
	}else if(allNums==maxNums){
		$(addrLi).show();
		addrMore.hide();
	}else if(allNums==0){
		addrList.html('您的地址为空，请先添加地址！');
		addrMore.hide();
	}else{
		addrMore.hide();
	}
}

//订单地址验证
function validateAddr(thisObj){
	var thisForm = $(thisObj).parents('.module_form_box'),
		mobile   = $(thisForm).find('#mobile'),
		realname = $(thisForm).find('#realname'),
		detail   = $(thisForm).find('#detail'),
		color    = '#FF7800';
		
	if(!realname.val()){
		layer.tips(realname.attr('null'), realname, {tips: [1, color]});
		return false;
	}
	if(!detail.val()){
		layer.tips(detail.attr('null'), detail, {tips: [1, color]});
		return false;
	}
	if(!mobile.val()){
		layer.tips(mobile.attr('null'), mobile, {tips: [1, color]});
		return false;
	}
	return true;
}

//计算总价
/*function calcTotalFee(){
	var totalPrice = 0;
	var moneyLi    = $('#shop_service li.money');
	moneyLi.each(function(){
		var obj = $(this);
		if(obj.attr('price')){
			var num   = obj.siblings('.num').find('em').text();
			totalPrice += parseFloat(obj.attr('price'))*parseInt(num);
		}
	});
	if(totalPrice<0){
		totalPrice = 0;
	}
	$("#total_price").text(totalPrice.toFixed(2));
}*/
</script>
</body>
</html>
